<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>采购清单展示</title>
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css" th:href="@{/lib/bootstrap/css/bootstrap.min.css}">
    <style>
        table{
            padding-bottom: 20px;
        }
    </style>
</head>
<body>
<div style="width: 90%;margin: auto;">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">采购清单<button style="float: right; margin-right: 30px;color: #000;" onclick="window.location.href='/main'">返回</button>
        </div>
    </div>
    <div class="father">
        <div style="width: 100%;padding-left: 50px;background-color:aquamarine;font-size: 20px;color:rgb(19, 80, 80);font-weight: 800;font-style: italic;">
            新采购清单[[${buy.getBNo()}]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[${buy.getBDate().getYear()+1900}]]年[[${buy.getBDate().getMonth()+1}]]月
        </div>
        <div class="son">
            <table class="table table-bordered table-hover table-striped"  >
                <thead>
                <tr>
                    <th>商品编号</th>
                    <th>数量</th>
                    <th>单价(￥)</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="buyInfo,iterStat:${buyInfos}">
                    <td th:text="${buyInfo.getId()}" th:id="${iterStat.index}" class="name">{{item.name}}</td>
                    <td th:text="${buyInfo.getNum()}">{{item.price}}</td>
                    <td th:text="${buyInfo.getPrice()}">{{item.num}}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script src="js/jquery.min.js"></script>
<script>
        $(".father").click(function(){
            var son= $(this).children(".son");
            son.slideToggle();
        })

        var names = $(".name")
        var detail = ['耐克运动鞋','波斯登羽绒服','阿迪短袖','马丁靴','雪碧','可乐','辣条','虾条','百乐钢笔','百乐墨水','橡皮','铅笔'];
        for(var i=0;i<names.length;i++){
            $(names[i]).text(detail[Number($(names[i]).text()-1)]);
        }
</script>
</body>
</html>